<!DocType html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <title>test</title>
    <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>

    <!--    智能机器人及网络-->
    <script src="https://cdn.jsdelivr.net/npm/axios@0.12.0/dist/axios.min.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/lodash@4.13.1/lodash.min.js"></script>

    <link rel="stylesheet" type="text/css" href="../../CSS/vue.css"/>

</head>
<body>

<div id="app">
    {{ message }}
</div>

<div id="app2">
    <span v-bind:title="message"> 鼠标悬停几秒查看此处动态绑定的提示信息 </span>
    <!--    <span title="message1"> 鼠标悬停几秒查看此处动态绑定的提示信息 </span>-->

</div>

<div id="app3">
<p v-if="seen">现在你看到我了</p>
</div>


<div id="app4">
    <ol>
        <li v-for="item in items">
            {{item.text}}
        </li>
    </ol>
</div>

<div id="app5">
    <p>{{message}}</p>
    <button v-on:click="reverseMessage">反转消息</button>
</div>

<div id="app6">
    <p>{{message1}}</p>
    <input v-model="message1">
</div>

<div id="app7">
    <ol>
        <todo-item v-for="item in groceryList" v-bind:item1="item" v-bind:key="item.id"></todo-item>
    </ol>
</div>

<script>
    let app = new Vue({
        el: '#app',
        data: {message: 'Hello Vue!'}
    })

    let app2 = new Vue({
        el: '#app2',
        data: {
            message: 'message时间:' + new Date().toLocaleString()
        }
    })

    let app3 = new Vue({
        el:'#app3',
        data:{
            seen:true
        }
    })

    let app4 = new Vue({
        el:'#app4',
        data:{
            items:[
                {text:'学习h5'},
                {text:'学习css'},
                {text:'学习javascript'}
            ]
        }
    })
    app4.items.push({'text':'dynamic add1'});
    app4.items.push({'text':'dynamic add2'});
    app4.items.pop();//删除最后一个


    let app5 = new Vue({
        el:'#app5',
        data:{
            message:'hello vue.js!'
        },
        methods:{
            reverseMessage:function () {
                this.message = this.message.split('').reverse().join('');
            }
        }
    })

    let app6 = new Vue({
        el:'#app6',
        data:{
            message1:'hello vue!'
        }
    })

        // <todo-item v-for="item in groceryList" v-bind:item="item" v-bind:key="item.id"></todo-item>

    Vue.component('todo-item',{
        template:'<li>{{item1.text}}</li>',
        props:['item1']
    })

    let app7 = new  Vue({
        el:'#app7',
        data:{
            groceryList:[
                {id:0,text:'text0'},
                {id:1,text:'text1'},
                {id:2,text:'text2'},
                {id:3,text:'text3'},
            ]
        }
    })

</script>

</body>
</html>